/** Header file for planet destruction
 *	Created 17.9.2009 by Raymond; common.h massacre
 *	*/
#ifndef WEAPON_H
#define WEAPON_H

#include "shot.h"

// Insert weapons here
enum WeaponType {
    WEAPON_GUN,
    WEAPON_LASER,
    WEAPON_BADGER,
    WEAPON_PLANETC,
    WEAPON_CARPET,
    WEAPON_CLUSTER,
    WEAPON_PANZERSCHRECK,
    WEAPON_BIGBANG
};

/** Class for different weapon  types different weapons probably will
 * subclass this*/
class Weapon {
    BITMAP *bmp;

    public:
    // Internal variables
    DataBank *data;
    double timer;
    int arg1;
    double arg_pos[2],arg_vel[2];
    // End

    Weapon(DataBank *d, WeaponType t);
    Shot *(*fire)(Player* player, DataBank* data, double *pos, double *vel);
    bool (*doFire)(Weapon *wp, Player *pl, double delta); // Continuous fire

    /** Returns a picture representation for the weapon */
    BITMAP* getPicture(class Weapon *w) { return bmp; }
    int ammo;
};

namespace W_Gun {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
    bool doFire(Weapon *wp, Player *pl, double delta);
};

namespace W_Laser {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

namespace W_Badger {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

namespace W_Carpet {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

namespace W_PlanetCreator {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

namespace W_Cluster {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

namespace W_Panzerschreck {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
    bool doFire(Weapon *wp, Player *pl, double delta);
};

namespace W_BigBang {
    Shot *fire(Player* player, DataBank* data, double *pos, double *vel);
};

#endif
